//
//  HYClientSocketViewModel.m
//  XPlayer
//
//  Created by 张水 on 2023/10/27.
//

#import "HYClientSocketViewModel.h"
#import "HYClientSocketModel.h"
@interface HYClientSocketViewModel()

@property (nonatomic, strong) NSMutableArray *dataSource;

@end

@implementation HYClientSocketViewModel

- (void)loadData
{
    {
        HYClientSocketModel *model = [[HYClientSocketModel alloc]init];
        model.title = NSLocalizedString(@"从相册中选取", nil);
        model.imageName = @"icon_picture";
        [self.dataSource hy_addObject:model];
    }
    {
        HYClientSocketModel *model = [[HYClientSocketModel alloc]init];
        model.title = NSLocalizedString(@"从文件导入中选取", nil);
        model.imageName = @"icon_folder";
        [self.dataSource hy_addObject:model];
    }
}

- (NSInteger)numberOfSectionsInCollectionView:(NSInteger)section
{
    return self.dataSource.count;
}

- (id)cellForRowAtIndexPathInCollectionView:(NSIndexPath *)indexPath
{
    return self.dataSource[indexPath.item];
}

- (void)didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    [self.updatedContentSignal sendNext:[NSString stringWithFormat:@"%ld",(long)indexPath.item]];
}
- (NSMutableArray *)dataSource
{
    if (_dataSource == nil) {
        _dataSource = [NSMutableArray array];
    }
    return _dataSource;
}

@end
